<?php
/**
 * 支付类
 * @author jroam
 *
 */
class payAction extends Action
{
	/**
	 * 保存订金的修改
	 */
	function savedingjing()
	{
		$mr=M("pay");
		$pay0=$_REQUEST["pay0"];
		$orderid=$_REQUEST["orderid"];
		$data["pay3"]=$_REQUEST["pay3"];
		$data["pay11"]=$_REQUEST["pay11"];
		$data["pay4"]=$_REQUEST["pay4"];
		$data["pay5"]=$_REQUEST["pay5"];
		
		if($data["pay4"]!="") $data["pay4"]=formattime($data["pay4"]);
		if($_REQUEST["pay6"]=="1"){
			$data["pay6"]=1;
			$data["pay13"]=$_REQUEST["pay13"];//员工确认支付成功时的名字
		}
		if($pay0==""){ 
			$data["pay1"]=$_REQUEST["orderno"];//订单号
			
			$flag=$mr->add($data);
		}else{
			$flag=$mr->where("pay0=".$pay0)->save($data);
		}
		
		if($flag){
			alert(__APP__."/orderform/hoteleditorder/id/".$orderid,2,"订金修改成功");
		}
		else{
			alert(__APP__."/orderform/hoteleditorder/id/".$orderid,2,"订金修改失败");
		}
		

		
	}
	/**
	 * 
	 */
	function saveyukuan()
	{
		$mr=M("pay");
		$pay0=$_REQUEST["pay0"];
		$orderid=$_REQUEST["orderid"];
		
		$data["pay7"]=$_REQUEST["pay7"];
		$data["pay12"]=$_REQUEST["pay12"];
		$data["pay8"]=$_REQUEST["pay8"];
		$data["pay9"]=$_REQUEST["pay9"];

		if($data["pay8"]!="") $data["pay8"]=formattime($data["pay8"]);
		if($_REQUEST["pay10"]=="1")
		{
			$data["pay10"]=1;
			$data["pay14"]=$_REQUEST["pay14"];//员工确认余款支付成功时的名字
		}
		if($mr->where("pay0=".$pay0)->save($data))
		{
			alert(__APP__."/orderform/hoteleditorder/id/".$orderid,2,"余款修改成功");
			//$this->display();
		}
		else
		{
			alert(__APP__."orderform/hoteleditorder/id/".$orderid,2,"余款修改失败");
		}
	}
	
}

?>